package domain;

import java.util.Date;
import java.util.Objects;

/**
 * 社团管理员类
 *
 * @author liujiale
 */
public class ClubAdministrator extends StudentAccount {

    /** 社团管理员ID */
    private int clubAdminID;

    /**
     * 默认构造方法
     */
    public ClubAdministrator(){
    }

    /**
     * 实现StudentAccount的构造函数，不带clubAdminID
     *
     * @param gender    性别，男性为true，女性为false
     * @param college   学院
     * @param studentID 学生ID
     */
    public ClubAdministrator(boolean gender, String college, String studentID) {
        super(gender, college, studentID);
    }

    /**
     * 实现StudentAccount的构造函数，带clubAdminID
     *
     * @param gender      性别，男性为true，女性为false
     * @param college     学院
     * @param studentID   学生ID
     * @param clubAdminID 社团管理员ID
     */
    public ClubAdministrator(boolean gender, String college, String studentID, int clubAdminID) {
        super(gender, college, studentID);
        this.clubAdminID = clubAdminID;
    }

    /**
     * 实现Account和StudentAccount的构造函数，带clubAdminID
     *
     * @param username   用户名
     * @param password   密码
     * @param nickname   昵称
     * @param telephone  电话
     * @param email      邮箱
     * @param createTime 账户创建时间
     * @param gender      性别，男性为true，女性为false
     * @param college     学院
     * @param studentID   学生ID
     * @param clubAdminID 社团管理员ID
     */
    public  ClubAdministrator(String username, String password, String nickname, String telephone, String email, Date createTime,boolean gender, String college, String studentID, int clubAdminID) {
        super(username, password, nickname, telephone, email, createTime, gender, college, studentID);
        this.clubAdminID = clubAdminID;
    }

    /**
     * Gets club admin id.
     *
     * @return the club admin id
     */
    public int getClubAdminID() {
        return clubAdminID;
    }

    /**
     * Sets club admin id.
     *
     * @param clubAdminID the club admin id
     */
    public void setClubAdminID(int clubAdminID) {
        this.clubAdminID = clubAdminID;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ClubAdministrator)) {
            return false;
        }
        ClubAdministrator that = (ClubAdministrator) o;
        return clubAdminID == that.clubAdminID;
    }

    @Override
    public int hashCode() {
        return Objects.hash(clubAdminID);
    }

    @Override
    public String toString() {
        return "ClubAdministrator{" +
                "clubAdminID=" + clubAdminID +
                '}';
    }
}
